<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libslic3r: src/libslic3r/BridgeDetector.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Slic3r_192px_transparent.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libslic3r
   </div>
   <div id="projectbrief">Library for generating gcode from 3d models</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_f69e6fbaea45487e96bc9ed8ccf9ff8f.html">libslic3r</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">BridgeDetector.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_bridge_detector_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef slic3r_BridgeDetector_hpp_</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define slic3r_BridgeDetector_hpp_</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="libslic3r_8h.html">libslic3r.h</a>&quot;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_ex_polygon_8hpp.html">ExPolygon.hpp</a>&quot;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_ex_polygon_collection_8hpp.html">ExPolygonCollection.hpp</a>&quot;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_slic3r.html">Slic3r</a> {</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_bridge_detector.html">   11</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_slic3r_1_1_bridge_detector.html">BridgeDetector</a> {</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_bridge_detector.html#a125092fbdf644b7e2aca67794c7603d2">   14</a></span>&#160;    <a class="code" href="class_slic3r_1_1_ex_polygon.html">ExPolygon</a> <a class="code" href="class_slic3r_1_1_bridge_detector.html#a125092fbdf644b7e2aca67794c7603d2">expolygon</a>;</div><div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_bridge_detector.html#a8ff570060a63482d1043a00664085bca">   16</a></span>&#160;    <a class="code" href="class_slic3r_1_1_ex_polygon_collection.html">ExPolygonCollection</a> <a class="code" href="class_slic3r_1_1_bridge_detector.html#a8ff570060a63482d1043a00664085bca">lower_slices</a>;</div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_bridge_detector.html#addc71fb7632124d7df9926dbffca00f3">   18</a></span>&#160;    <a class="code" href="namespace_slic3r.html#ab6d77625bc973b0c03e577944f90f297">coord_t</a> <a class="code" href="class_slic3r_1_1_bridge_detector.html#addc71fb7632124d7df9926dbffca00f3">extrusion_width</a>;</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_bridge_detector.html#aa50125dca65906a7567fcc04e56baf9f">   20</a></span>&#160;    <span class="keywordtype">double</span> <a class="code" href="class_slic3r_1_1_bridge_detector.html#aa50125dca65906a7567fcc04e56baf9f">resolution</a>;</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_bridge_detector.html#acfae4e052886fd1f0e25eeb4441a531a">   22</a></span>&#160;    <span class="keywordtype">double</span> <a class="code" href="class_slic3r_1_1_bridge_detector.html#acfae4e052886fd1f0e25eeb4441a531a">angle</a>;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    </div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    <a class="code" href="class_slic3r_1_1_bridge_detector.html#ad726446e8e32f075854435359492376f">BridgeDetector</a>(<span class="keyword">const</span> <a class="code" href="class_slic3r_1_1_ex_polygon.html">ExPolygon</a> &amp;_expolygon, <span class="keyword">const</span> <a class="code" href="class_slic3r_1_1_ex_polygon_collection.html">ExPolygonCollection</a> &amp;_lower_slices, <a class="code" href="namespace_slic3r.html#ab6d77625bc973b0c03e577944f90f297">coord_t</a> _extrusion_width);</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_slic3r_1_1_bridge_detector.html#acbdfe1a5e3a7aebd7dbafd7f8df46afb">detect_angle</a>();</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a> <a class="code" href="class_slic3r_1_1_bridge_detector.html#acb5688a50b301a3725b969aa4753a57c">coverage</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a> <a class="code" href="class_slic3r_1_1_bridge_detector.html#acb5688a50b301a3725b969aa4753a57c">coverage</a>(<span class="keywordtype">double</span> angle) <span class="keyword">const</span>;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    </div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <a class="code" href="namespace_slic3r.html#a498065f79ccb865fc410d4afeacffc9c">Polylines</a> <a class="code" href="class_slic3r_1_1_bridge_detector.html#aa0e4cd5056c1c06a325d98be1e11eadd">unsupported_edges</a>(<span class="keywordtype">double</span> angle = -1) <span class="keyword">const</span>;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    </div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <a class="code" href="namespace_slic3r.html#a498065f79ccb865fc410d4afeacffc9c">Polylines</a> _edges;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <a class="code" href="namespace_slic3r.html#a9306b728b4672f5e56abe05ba7437fe1">ExPolygons</a> _anchors;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    </div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    <span class="keyword">class </span>BridgeDirection {</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        <span class="keyword">public</span>:</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;        BridgeDirection(<span class="keywordtype">double</span> a = -1.) : angle(a), <a class="code" href="class_slic3r_1_1_bridge_detector.html#acb5688a50b301a3725b969aa4753a57c">coverage</a>(0.), max_length(0.) {}</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        <span class="keywordtype">bool</span> operator&lt;(<span class="keyword">const</span> BridgeDirection &amp;other)<span class="keyword"> const </span>{</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;            <span class="comment">// Initial sort by coverage only - comparator must obey strict weak ordering</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;            <span class="keywordflow">return</span> this-&gt;<a class="code" href="class_slic3r_1_1_bridge_detector.html#acb5688a50b301a3725b969aa4753a57c">coverage</a> &gt; other.coverage;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;        };</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        <span class="keywordtype">double</span> <a class="code" href="class_slic3r_1_1_bridge_detector.html#acfae4e052886fd1f0e25eeb4441a531a">angle</a>;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        <span class="keywordtype">double</span> <a class="code" href="class_slic3r_1_1_bridge_detector.html#acb5688a50b301a3725b969aa4753a57c">coverage</a>;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        <span class="keywordtype">double</span> max_length;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    };</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;};</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;}</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="class_slic3r_1_1_bridge_detector_html_a125092fbdf644b7e2aca67794c7603d2"><div class="ttname"><a href="class_slic3r_1_1_bridge_detector.html#a125092fbdf644b7e2aca67794c7603d2">Slic3r::BridgeDetector::expolygon</a></div><div class="ttdeci">ExPolygon expolygon</div><div class="ttdoc">The non-grown hole. </div><div class="ttdef"><b>Definition:</b> BridgeDetector.hpp:14</div></div>
<div class="ttc" id="libslic3r_8h_html"><div class="ttname"><a href="libslic3r_8h.html">libslic3r.h</a></div></div>
<div class="ttc" id="namespace_slic3r_html_ab6d77625bc973b0c03e577944f90f297"><div class="ttname"><a href="namespace_slic3r.html#ab6d77625bc973b0c03e577944f90f297">Slic3r::coord_t</a></div><div class="ttdeci">long coord_t</div><div class="ttdef"><b>Definition:</b> libslic3r.h:41</div></div>
<div class="ttc" id="namespace_slic3r_html_ac070ff2d90c6488a48adf1814cdae06c"><div class="ttname"><a href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Slic3r::Polygons</a></div><div class="ttdeci">std::vector&lt; Polygon &gt; Polygons</div><div class="ttdef"><b>Definition:</b> Polygon.hpp:13</div></div>
<div class="ttc" id="class_slic3r_1_1_bridge_detector_html_acb5688a50b301a3725b969aa4753a57c"><div class="ttname"><a href="class_slic3r_1_1_bridge_detector.html#acb5688a50b301a3725b969aa4753a57c">Slic3r::BridgeDetector::coverage</a></div><div class="ttdeci">Polygons coverage() const</div><div class="ttdef"><b>Definition:</b> BridgeDetector.cpp:184</div></div>
<div class="ttc" id="_ex_polygon_collection_8hpp_html"><div class="ttname"><a href="_ex_polygon_collection_8hpp.html">ExPolygonCollection.hpp</a></div></div>
<div class="ttc" id="class_slic3r_1_1_bridge_detector_html"><div class="ttname"><a href="class_slic3r_1_1_bridge_detector.html">Slic3r::BridgeDetector</a></div><div class="ttdef"><b>Definition:</b> BridgeDetector.hpp:11</div></div>
<div class="ttc" id="class_slic3r_1_1_ex_polygon_collection_html"><div class="ttname"><a href="class_slic3r_1_1_ex_polygon_collection.html">Slic3r::ExPolygonCollection</a></div><div class="ttdef"><b>Definition:</b> ExPolygonCollection.hpp:14</div></div>
<div class="ttc" id="class_slic3r_1_1_bridge_detector_html_ad726446e8e32f075854435359492376f"><div class="ttname"><a href="class_slic3r_1_1_bridge_detector.html#ad726446e8e32f075854435359492376f">Slic3r::BridgeDetector::BridgeDetector</a></div><div class="ttdeci">BridgeDetector(const ExPolygon &amp;_expolygon, const ExPolygonCollection &amp;_lower_slices, coord_t _extrusion_width)</div><div class="ttdef"><b>Definition:</b> BridgeDetector.cpp:8</div></div>
<div class="ttc" id="class_slic3r_1_1_bridge_detector_html_acbdfe1a5e3a7aebd7dbafd7f8df46afb"><div class="ttname"><a href="class_slic3r_1_1_bridge_detector.html#acbdfe1a5e3a7aebd7dbafd7f8df46afb">Slic3r::BridgeDetector::detect_angle</a></div><div class="ttdeci">bool detect_angle()</div><div class="ttdef"><b>Definition:</b> BridgeDetector.cpp:56</div></div>
<div class="ttc" id="class_slic3r_1_1_bridge_detector_html_a8ff570060a63482d1043a00664085bca"><div class="ttname"><a href="class_slic3r_1_1_bridge_detector.html#a8ff570060a63482d1043a00664085bca">Slic3r::BridgeDetector::lower_slices</a></div><div class="ttdeci">ExPolygonCollection lower_slices</div><div class="ttdoc">Lower slices, all regions. </div><div class="ttdef"><b>Definition:</b> BridgeDetector.hpp:16</div></div>
<div class="ttc" id="class_slic3r_1_1_bridge_detector_html_addc71fb7632124d7df9926dbffca00f3"><div class="ttname"><a href="class_slic3r_1_1_bridge_detector.html#addc71fb7632124d7df9926dbffca00f3">Slic3r::BridgeDetector::extrusion_width</a></div><div class="ttdeci">coord_t extrusion_width</div><div class="ttdoc">Scaled extrusion width of the infill. </div><div class="ttdef"><b>Definition:</b> BridgeDetector.hpp:18</div></div>
<div class="ttc" id="namespace_slic3r_html"><div class="ttname"><a href="namespace_slic3r.html">Slic3r</a></div><div class="ttdef"><b>Definition:</b> BoundingBox.cpp:4</div></div>
<div class="ttc" id="class_slic3r_1_1_ex_polygon_html"><div class="ttname"><a href="class_slic3r_1_1_ex_polygon.html">Slic3r::ExPolygon</a></div><div class="ttdef"><b>Definition:</b> ExPolygon.hpp:16</div></div>
<div class="ttc" id="namespace_slic3r_html_a498065f79ccb865fc410d4afeacffc9c"><div class="ttname"><a href="namespace_slic3r.html#a498065f79ccb865fc410d4afeacffc9c">Slic3r::Polylines</a></div><div class="ttdeci">std::vector&lt; Polyline &gt; Polylines</div><div class="ttdef"><b>Definition:</b> Polyline.hpp:14</div></div>
<div class="ttc" id="class_slic3r_1_1_bridge_detector_html_aa50125dca65906a7567fcc04e56baf9f"><div class="ttname"><a href="class_slic3r_1_1_bridge_detector.html#aa50125dca65906a7567fcc04e56baf9f">Slic3r::BridgeDetector::resolution</a></div><div class="ttdeci">double resolution</div><div class="ttdoc">Angle resolution for the brute force search of the best bridging angle. </div><div class="ttdef"><b>Definition:</b> BridgeDetector.hpp:20</div></div>
<div class="ttc" id="namespace_slic3r_html_a9306b728b4672f5e56abe05ba7437fe1"><div class="ttname"><a href="namespace_slic3r.html#a9306b728b4672f5e56abe05ba7437fe1">Slic3r::ExPolygons</a></div><div class="ttdeci">std::vector&lt; ExPolygon &gt; ExPolygons</div><div class="ttdef"><b>Definition:</b> ExPolygon.hpp:13</div></div>
<div class="ttc" id="class_slic3r_1_1_bridge_detector_html_aa0e4cd5056c1c06a325d98be1e11eadd"><div class="ttname"><a href="class_slic3r_1_1_bridge_detector.html#aa0e4cd5056c1c06a325d98be1e11eadd">Slic3r::BridgeDetector::unsupported_edges</a></div><div class="ttdeci">Polylines unsupported_edges(double angle=-1) const</div><div class="ttdef"><b>Definition:</b> BridgeDetector.cpp:261</div></div>
<div class="ttc" id="class_slic3r_1_1_bridge_detector_html_acfae4e052886fd1f0e25eeb4441a531a"><div class="ttname"><a href="class_slic3r_1_1_bridge_detector.html#acfae4e052886fd1f0e25eeb4441a531a">Slic3r::BridgeDetector::angle</a></div><div class="ttdeci">double angle</div><div class="ttdoc">The final optimal angle. </div><div class="ttdef"><b>Definition:</b> BridgeDetector.hpp:22</div></div>
<div class="ttc" id="_ex_polygon_8hpp_html"><div class="ttname"><a href="_ex_polygon_8hpp.html">ExPolygon.hpp</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
